var app = getApp()
import ajaxhelper from '../../utils/ajaxhelper.js';
import { signByMd5 } from "../../utils/util";
Page({
  data: { 
    userName:'hi',
    avatarUrl:'http://image.chuangchuang.cn/chuangchuang/cc_other/20171222/20171222_1513932164330.png',
  },
  onLoad:function(options){
    var getUserInfo = wx.getStorageSync('getUserInfo');
    if (getUserInfo) {
      this.setData({
        userName: getUserInfo.nickName,
        avatarUrl: getUserInfo.avatarUrl
      })
    } 
  },

  // 我的订阅
  goSubscribe(){
    wx.navigateTo({
      url: '../alSubscribe/alSubscribe',
    })
  },
  // 我的订单
  goOrder(){
    wx.navigateTo({
      url: '../orderList/orderList',
    })
  },
  // 购买记录
  goBuyHistory(){
     wx.navigateTo({
       url: '../buyHistory/buyHistory',
     })
  },

  // 已购买
  goPurchased(){
    wx.navigateTo({
      url: '../purchased/purchased',
    })
  },
  goRedPack(){
    wx.navigateTo({
      url: '../myRedPack/myRedPack',
    })
  },
  goGiftCard(){
    wx.navigateTo({
      url: '../giftCards/giftCards',
    })
  },
  goAccountBalance(){
    wx.navigateTo({
      url: '../accountBalance/accountBalance',
    })
  },
  // 用户退出
  // edit(e){
  //   console.log(e)
  //   try {
  //     console.log(2222)
  //     wx.clearStorageSync()
  //     this.setData({
  //       userName:'hi',
  //       CurrentCoin: 0
  //     })
  //   } catch (e) {
  //     // Do something when catch error
  //   }
  // }
})
